{template '_header'}

<div class="page-header">
    当前位置：<span class="text-primary"> 订单管理 </span>
</div>
<div class="page-content">
<form action="{php echo webUrl('identity/order')}" method="get" class="form-horizontal" role="form" id="form1">
    <input type="hidden" name="c" value="site" />
    <input type="hidden" name="a" value="entry" />
    <input type="hidden" name="m" value="ewei_shopv2" />
    <input type="hidden" name="do" value="web" />
    <input type="hidden" name="r" value="identity.order" />

    <div class="page-toolbar m-b-sm m-t-sm">
        <!-- <div class="col-sm-3">
             <span class='pull-left'>
                    <a class='btn btn-primary btn-sm' href="{php echo webUrl('identity/order/add')}"><i class="fa fa-plus"></i> 添加门店海报</a>
                </span>
        </div> -->

        <div class="col-sm-8 pull-right">
            <div class="input-group">
                <div class="input-group-select">
                    <select name="identity_id" class='form-control  input-sm select-md' style="width:100px;"  >
                        <option value='0'>身份</option>
                        {loop $identity $row}
                        <option value="{$row['id']}">{$row['name']}</option>
                        {/loop}
                        <!-- <option value='-1' {if $_GPC['status']=='-1'}selected{/if}>审核未通过</option> -->
                    </select>
                </div>
                <div class="input-group-select">
                    <select name='status' class='form-control  input-sm select-md' style="width:100px;"  >
                        <option value='0'>状态</option>
                        <option value='1' {if $_GPC['status']=='1'}selected{/if}>已确认</option>
                        <option value='2' {if $_GPC['status']=='2'}selected{/if}>待确认</option>
                        <option value='3' {if $_GPC['status']=='3'}selected{/if}>退单申请</option>
                        <option value='4' {if $_GPC['status']=='4'}selected{/if}>已退单</option>
                        <!-- <option value='-1' {if $_GPC['status']=='-1'}selected{/if}>审核未通过</option> -->
                    </select>
                </div>
                <input type="text" class="form-control input-sm"  name="keyword" value="{$_GPC['keyword']}" placeholder="会员昵称/升级身份"/>
				<span class="input-group-btn">
                    <button class="btn btn-primary" type="submit"> 搜索</button>
                    <button type="submit" name="export" value="1" class="btn btn-success">导出</button>
				</span>
            </div>

        </div>
    </div>
</form>

<div class="page-table-header">
    <input type="checkbox">
    <div class="btn-group">
        {ifp 'identity.order.edit'}
        <a class='btn btn-default btn-sm btn-operation'  data-toggle='batch' data-href="{php echo webUrl('identity/order/status',array('status'=>1))}"  data-confirm='确认要确认所选订单吗?'>
            <i class="icow icow-qiyong"></i>确认
        </a>
        {loop $identity $row}
        <a class='btn btn-default btn-sm btn-operation'  data-toggle='batch' data-href="{php echo webUrl('identity/order/editidentity',array('identity_id'=>$row['id']))}" data-confirm='确认要修改所有要升级的身份吗?'>
            {$row['name']}
        </a>
        {/loop}
        {/if}
        <!-- {ifp 'identity.order.delete'}
        <a class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除?" data-href="{php echo webUrl('identity/order/delete')}">
            <i class='icow icow-shanchu1'></i> 删除
        </a>
        {/if} -->
    </div>
</div>
<table class="table table-responsive table-hover" >
    <thead class="navbar-inner">
    <tr>
        <th style="width:40px;"></th>
        <th style="width:150px;">用户名</th>
        <th style="width:100px;">购买身份</th>
        <th style="width:100px;">购买价格/数量</th>
        <th style="width:100px;">订单状态</th>
        <th style="width:100px;">身份状态</th>
        <th style="width:80px;">购买时间</th>
        <th style="width:80px;">操作</th>
    </tr>
    </thead>
    
{if count($list)>0}
    <tbody>
    {loop $list $row}
    <tr>
        <td>
            <input type='checkbox'   value="{$row['id']}"/>
        </td>
     
        <td>{$row['user_name']}</td>
        <td>{$row['identity']}
            <!-- <img src="{php echo tomedia($row['thumb'])}" style="width:40px;height:40px;padding:1px;border:1px solid #ccc;" onerror="this.src='../addons/ewei_shopv2/static/images/nopic.png'"/> -->
        </td>
        <td>&yen;{$row['goods_price']} X {$row['goods_total']}</td>
        <td>{$row['ostatus']}</td>
        <td>{$row['status']}
            <!-- <span class='label {if $row['status']==1}label-primary{else}label-default{/if}'
            {ifp 'identity.order.edit'}
            data-toggle='ajaxSwitch'
            data-switch-value='{$row['status']}'
            data-switch-value0='0|待确认|label label-default|{php echo webUrl('identity/order/status',array('status'=>1,'id'=>$row['id']))}'
            data-switch-value1='1|已确认|label label-success|{php echo webUrl('identity/order/status',array('status'=>0,'id'=>$row['id']))}'
            {/if} ></span> -->
            
            <!-- {if $row['status']==1}已确认{elseif $row['status']==0}待确认{else}{$row['status']}{/if} -->
            
        </td>
        <td>{$row['buy_time']}</td>
        <td style="text-align:left;">

            {ifp 'identity.order.view|identity.order.edit'}
            <a href="{php echo webUrl('identity/order/edit', array('id' => $row['id']))}" class="btn btn-default btn-sm btn-op btn-operation">
                  <span data-toggle="tooltip" data-placement="top" title="" data-original-title="查看">
                    <i class='icow icow-bianji2'></i>
               </span>
            </a>
            {/if}

            <!-- {ifp 'identity.order.delete'}
            <a data-toggle='ajaxRemove' class="btn btn-default btn-sm btn-op btn-operation ajaxRemove" data-confirm='确认要删除该门店吗?' href="{php echo webUrl('identity/order/delete', array('id'=>$row['id']))}" identityid="$row['id']">
              <span data-toggle="tooltip" data-placement="top" title="" data-original-title="删除">
                     <i class='icow icow-shanchu1'></i>
                </span></a>
            {/if} -->
        </td>
    </tr>
    {/loop}
    </tbody>
    <tfoot>
        <tr>
            <td><input type="checkbox"></td>
            <td colspan="4">
                <div class="btn-group">
                    {ifp 'identity.order.edit'}
                    <a class='btn btn-default btn-sm btn-operation'  data-toggle='batch' data-href="{php echo webUrl('identity/order/status',array('status'=>1))}"  data-confirm='确认要确认所选订单吗?'>
                        <i class="icow icow-qiyong"></i>确认
                    </a>
                    {loop $identity $row}
                    <a class='btn btn-default btn-sm btn-operation'  data-toggle='batch' data-href="{php echo webUrl('identity/order/editidentity',array('identity_id'=>$row['id']))}" data-confirm='确认要修改所有要升级的身份吗?'>
                        {$row['name']}
                    </a>
                    {/loop}
                    {/if}
                    <!-- {ifp 'identity.order.delete'}
                    <a class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除?" data-href="{php echo webUrl('identity/order/delete')}"><i class='icow icow-shanchu1'></i> 删除</a>
                    {/if} -->
                </div>
            </td>
            <td colspan="3" class="text-right">
                {$pager}
            </td>
        </tr>
    </tfoot>
</table>
{else}
<div class='panel panel-default'>
    <div class='panel-body' style='text-align: center;padding:30px;'>
        暂时没有任何订单!
    </div>
</div>
{/if}

    </div>
<script language="javascript">
    // $(".ajaxRemove").click(function(){
    //     $.ajax({
    //         type: "GET",
    //         url: "{php echo webUrl('identity/order/delete')}",
    //         data: "id="+$(this).attr('identityid'),
    //         dataType: "json",
    //         success: function (data) {
    //             $(this).parent().parent().html();
    //         }
    //     });
    // });
        
</script>

{template '_footer'}
<!--6Z2S5bKb5piT6IGU5LqS5Yqo572R57uc56eR5oqA5pyJ6ZmQ5YWs5Y+4-->